Org-mode all the thingz!

Nick Anderson

Created: 2019-08-11 Sun 10:18

org-mode

Who am I?

  • Hail from Lawrence, KS
  • Work in Open Source mostly on CFEngine at Northern.tech

#+BEGIN_NOTES

  • Background as sysadmin
  • C, CFEngine Policy, Shell, Perl, Python, PHP, SQL, Ruby,
  • Work with customers, developers, business
  • Make presentations, documents, reports

#+END_NOTE

What is it?

  • around since 2003
  • markup language
  • best supported in emacs
  • system for managing plain text
  • a second brain or exocortex

An aside for non emacs users

What is it for?

  • task manager/planner
  • authoring/outlining documents
  • keeping notes, maintaining todo lists, planning projects

Things I do, what interests you?

Worklog/Literate *Ops

org-capture

  • Capture something you need without breaking your flow

org-capture supports sub menus

templates improve speed and consistency

Example meeting template

    ;; BEGIN Capture Templates
    ;; I picked up this neat trick from the Venerable Sacha Chua
    (defvar my/org-meeting-template-planning "* %u Meeting About CFEngine Planning   %^G
CREATED: %U

*Agenda:*
 - Demos
 - Review work in progress
 - Review newly registered issues
 - [[https://tracker.mender.io/secure/RapidBoard.jspa?rapidView=26][CFEngine Kanban board]]

** Demos
** WIP
** New Issues


" "Meeting Template - Planning")

Configuring capture templates

;; Configure custom capture templates
(setq org-capture-templates
      `(;; Note the backtick here, it's required so that the defvar based tempaltes will work!
        ;;http://comments.gmane.org/gmane.emacs.orgmode/106890

        ;; I have lot's of meetings, so lets have a submenu
        ("m" "Meetings" )
        ("mp" "Meeting - Planning/Review" entry (file "~/org/Work/northern.tech/development-meetings.org" )
         ,my/org-meeting-template-planning :clock-in t :clock-resume t :append t :empty-lines-after 1)
        ))

Time Tracking

  • org-clock-in, org-clock-out, org-clock-goto, org-clock-report, org-clock-resolve-clocks

Clocking in and out of tasks

Clock Reports

Jira

Screenshot/Cast

org-download
org-download-screenshot, drag and drop,
camcorder
start and stop screen recording, convert to gif

Notes

Deft

  • For one file per note organization (kind of like Evernote)

Code blocks

CFEngine

#+NAME:CFEngine-hello-world
#+BEGIN_SRC cfengine3 :include-stdlib t :log-level info :exports both :run-with-main t
  reports: 'CFEngine says "Hello, World!"'; 
#+END_SRC

#+RESULTS: CFEngine-hello-world
: R: CFEngine says "Hello, World!"

Python

#+BEGIN_SRC python :results output
  print("Python says \"Hello, World!\"") 
#+END_SRC

#+RESULTS:
: Python says "Hello, World!"

Shell

#+BEGIN_SRC sh :results output
  echo "$SHELL says \"Hello, World!\"" 
#+END_SRC

#+RESULTS:
: /usr/bin/zsh says "Hello, World!"

Reusing results

#+BEGIN_SRC sh :results output :var INPUT=CFEngine-hello-world
  echo "$INPUT" 
#+END_SRC

#+RESULTS:
: R: CFEngine says "Hello, World!"
: 

Remote execution

#+CAPTION: SQL in org-mode SRC block
#+BEGIN_SRC sql :exports both :dir /ssh:user@remote: :engine postgresql :database cfdb
  SELECT firstreporttimestamp from __hosts limit 1
#+END_SRC

#+RESULTS:
| firstreporttimestamp         |
|------------------------------|
| 2019-02-15 19:49:57.74915+00 |

Diagrams

PlantUML Source

#+NAME: MPF-policy-execution-high-level-diagram
#+begin_src plantuml :file MPF-policy-execution-high-level.png :exports both
  title High Level MPF Policy Execution Sequence

  create "cf-execd"
  loop "Check ""body executor control schedule"""
    note left of "cf-execd"
      cf-execd checks the schedule once a minute, but the default schedule results
      in execution once every 5 minutes.
    end note

Literate programming

  • Donald Knuth

Examples

Exporting

HTML Theme Readtheorg

HTML Theme BigBlow

PDF

Email

mu4e

Keeping Secrets

  • Tag entries with crypt to automatically encrypt sections of a file with GPG
  • org-decrypt-entry

For my eyes only

–—BEGIN PGP MESSAGE–—

hQIMA/jYNcPWXvJ6AQ//arpfgjdLa/EwjMhxj8AA7X1qkAB/da9LKyuOoDzMWaMc p+3HqpdC0n5/KsfmQes4KBfyHOf3Ty3FzlNwBVA9qwGFY1UfXV8WYAAv2MZF/97p riWzuMVBNgcdm/rCQTdP5zUgOCzpquJxDvnB39+E0dMvBY9sVjvJphzXEa6goz+6 8QHYyDSNDcvSIwZv3Oi+0wxAasTptYuPOqmwfRoybICICgoX/Sn2d7NH5sYclYRg nQJ6nGO4ozq/oRKPy/oD+YlgOUDeGlCeA+D0XsLW0DAdGigIHZ571cijEAvNj1QP eGGZ/fIm46gL5XU+CzK6rq9KqXtH2zTTzVJYRRzRhe7Fwtcgc0KPm1D+YqEyPBrK mPdqpGNYU9Ko6muBDUj+MTIIeDKdOc4Ao778h41lGTjqSQ4v+2N6AB0HcQV09vMt 9GyHLKUiM5H8qxtvewGXBil7iZh9MxlNdyNG57eoCIfjnMysX6KX3hoicrFD3Tps 1pojbZRXu1xaKSkaH5Pcx89NbkJXZRA9fvFqvT6/LZDAhJ+Fs2vgo9M+K8PaUuq5 dp9EEWvc6FIkPXIgf0cArdZHR9Gm+f4gXA/mf5e4GLUrmH7SifFV3xrLdyyEat7X f1OsFWwOjmGz6aXBaOKgu/74EVYX+l1ap2j/0a7ZSdVchqL7g57njD0XN/6eILHS TAGe8a76cd/M0BO42W9+VYsUWKSb0e9+Z7fHPmo3VpcriaVl/OTJqdEcQTY98J5l XZdnAeMFy0z3ntITFFbjlNbhNpMlXRxWs0xJi4k= =bdCS –—END PGP MESSAGE–—

Blogging

Journaling

org-journal

Stored one file per day

ls ~/org/journal | grep -P "2019-0[345]" | head -n 5
2019-03-03
2019-03-06
2019-03-11
2019-03-12
2019-03-14

org-datetree, org-reverse-datetree

  • Many entries in one file

Presentations

Tables/Spreadsheets

Table 1: @>$2=vmin(@2..@-1)::@>$3=vmax(@2..@-1)::@>$4=vmean(@2..@-1)::@>$5=vsum(@2..@-1)
Item Low Value High Value Mean Sum
Hammer 1 100 10 11
More 3 200 11 8
Axe 20 25 30 13
Total: 1 200 17 32
  • Each formula is separated with ::
  • @ indicates the ROW (@> means last row)
  • $ indicates the COLUMN

Live action

Referencing cells by name

Table 2: $l=vmin(@2..@-1)::$h=vmax(@2..@-1)::$m=vmean(@2..@-1)::$s=vsum(@2..@-1)
Item Low Value High Value Mean Sum
Hammer 10 20 10 10
Axe 20 25 30 13
^Total: 10 25 20 23
^ l h m s
  • ^ indicates field values on this line define names for the field ABOVE this row

Task Management/Calendaring

Keep agenda top of mind

Finding things

Also

  • org-caldav
  • org-calfw
  • org-gcal

Going Mobile

Android iOS Web
Orgzly MobileOrg org-web
Organic beorg  
MobileOrg    
SyncOrg    

Orgzly

Bookmarks and Web Archiving

org-web-tools
Convert webpage into org-format
org-board
bookmarking and archiving

Other stuff

  • archiving
  • org-drill
  • org-randomnote
  • org-d20, org-lookup-dnd
  • org-make-toc

Gimmie Moar

Created by Nick Anderson.